package com.white.bean;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 用户ID、用户名、密码、性别、年龄、地址、电话、头像、邮箱、关注总数、粉丝总数、文章总数、总字数、喜欢总数、余额、简介、注册时间。
 * create table user(
 * userId int primary key AUTO_INCREMENT comment "用户ID",
 * isAdm int not null default 0 comment "管理员标识符，默认0表示普通用户，1表示管理员",
 * name varchar(64) unique not null comment "用户名",
 * password varchar(255) not null comment "密码",
 * sex enum("男", "女") not null default "女" comment "性别",
 * age int not null default 0 comment "年龄",
 * address varchar(255)  comment "地址",
 * tel varchar(11)  comment "电话",
 * headImage varchar(255) comment "头像",
 * email varchar(64)  comment "邮箱",
 * balance double not null default 0 comment "账户余额",
 * follows int not null default 0 comment "关注总数",
 * fans int not null default 0 comment "粉丝总数",
 * articles int not null default 0 comment "文章总数",
 * words int not null default 0 comment "字数",
 * likes int not null default 0 comment "喜欢数",
 * profile varchar(1255)  comment "简介",
 * createTime TIMESTAMP not null  default CURRENT_TIMESTAMP comment '注册时间，默认当前时间戳'
 * );
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User  implements Serializable {
    @TableId(value = "userId")
    private Long userId;
    private int isAdm, age, follows, fans, articles, words, likes;
    private String name, password, sex, address, tel, headImage, email, profile, createTime, rewardProfile;
    private double balance;

    public User(Long userId, String name, String password) {
        this.userId = userId;
        this.name = name;
        this.password = password;
    }

    public User(Long userId, String name, String password, String address, String tel, String email) {
        this.userId = userId;
        this.name = name;
        this.password = password;
        this.address = address;
        this.tel = tel;
        this.email = email;
    }

    public User(String name, String password) {
        this.name = name;
        this.password = password;
    }

    public User(String name, String password, String sex, String address, String tel) {
        this.name = name;
        this.password = password;
        this.sex = sex;
        this.address = address;
        this.tel = tel;
    }

    public User(String name, String password, String headImage) {
        this.name = name;
        this.password = password;
        this.headImage = headImage;
    }
}
